Skip to content

[REFACTOR][IR] Unify StructInfo and Type#19853

Merged
spectrometerHBH merged 13 commits into
apache:mainfrom
tqchen:tvm-type-refactor-unify-expr-type-field-with-relax-structinfo
Jun 21, 2026
Merged

[REFACTOR][IR] Unify StructInfo and Type#19853
spectrometerHBH merged 13 commits into
apache:mainfrom
tqchen:tvm-type-refactor-unify-expr-type-field-with-relax-structinfo

Conversation

@tqchen

@tqchen tqchen commented Jun 21, 2026

Copy link
Copy Markdown
Member

Summary

  • unify Relax's former StructInfo surface into the Type vocabulary and Expr.ty storage path
  • remove leftover DependentTypeNode and legacy OpNode::op_type storage
  • keep base Type nullable while concrete Relax/DTensor type refs are non-nullable
  • clean stale StructInfo/TensorStructInfo/sinfo vocabulary in Python/docs and distributed-op macros
  • address Gemini follow-ups for parser annotations, BlockBuilder docstring, and Adreno TensorType cast audit

tqchen added 10 commits June 20, 2026 01:21
The Relax dependent type refactor needs the helper and analysis surfaces to use the consolidated type vocabulary instead of keeping StructInfo compatibility shims around.

This removes the remaining renamed helper wrappers, updates the public analysis and transform entry points to Type names, and tightens final stale-name cleanup in the nested-message and analysis internals.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request refactors the Relax dialect in TVM by replacing the StructInfo concept with a unified, richer dependent Type system across C++ source files, headers, Python bindings, and documentation. The review feedback highlights several critical and medium-severity issues, including potential null pointer dereferences in dependent_type.cc, type_functor.cc, type.h, and distributed/type.cc due to missing definition checks. Additionally, there are compilation risks identified in dependent_type.cc regarding the use of the potentially undefined TVM_FFI_ICHECK_GE macro, which should be replaced with the standard TVM_FFI_ICHECK macro.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread src/relax/ir/dependent_type.cc Outdated
Comment thread src/relax/ir/type_functor.cc
Comment thread include/tvm/relax/type.h Outdated
Comment thread src/relax/ir/dependent_type.cc Outdated
Comment thread src/relax/ir/dependent_type.cc Outdated
Comment thread src/relax/distributed/type.cc
@spectrometerHBH spectrometerHBH merged commit 1bb5cf6 into apache:main Jun 21, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants